using System.Windows.Controls;

namespace Silvery.Command
{
    public class Cmd_Cls : StandardCommand
    {
        public Cmd_Cls()
        {
            this.Command = "cls";
            base.Instruction = "清理所有输出的信息";
        }
        public override void Execute(IGameCommandBox parent, string parameter)
        {
            base.Execute(parent, parameter);
            if (parent.UotputControl is RichTextBox)
                (parent.UotputControl as RichTextBox).Blocks.Clear();
            else
                if (parent.UotputControl is TextBox)
                    (parent.UotputControl as TextBox).Text = string.Empty;
                else
                    if (parent.UotputControl is TextBlock)
                    {
                        (parent.UotputControl as TextBlock).Inlines.Clear();
                        (parent.UotputControl as TextBlock).Text = string.Empty;
                    }
        }
    }
}
